package com.ruoyi.web.controller.control;

import java.util.List;
import javax.servlet.http.HttpServletResponse;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.control.domain.GasDrainagePumpRoom;
import com.ruoyi.control.service.IGasDrainagePumpRoomService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 瓦斯抽放泵房Controller
 *
 * @author ruoyi
 * @date 2024-11-08
 */
@RestController
@RequestMapping("/control/gasRoom")
public class GasDrainagePumpRoomController extends BaseController {
    @Autowired
    private IGasDrainagePumpRoomService gasDrainagePumpRoomService;

    /**
     * 查询瓦斯抽放泵房列表
     */
    @PreAuthorize("@ss.hasPermi('control:gasRoom:list')")
    @GetMapping("/list")
    public TableDataInfo list(GasDrainagePumpRoom gasDrainagePumpRoom) {
        startPage();
        List<GasDrainagePumpRoom> list = gasDrainagePumpRoomService.selectGasDrainagePumpRoomList(gasDrainagePumpRoom);
        return getDataTable(list);
    }

    /**
     * 导出瓦斯抽放泵房列表
     */
    @PreAuthorize("@ss.hasPermi('control:gasRoom:export')")
    @Log(title = "瓦斯抽放泵房", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, GasDrainagePumpRoom gasDrainagePumpRoom) {
        List<GasDrainagePumpRoom> list = gasDrainagePumpRoomService.selectGasDrainagePumpRoomList(gasDrainagePumpRoom);
        ExcelUtil<GasDrainagePumpRoom> util = new ExcelUtil<GasDrainagePumpRoom>(GasDrainagePumpRoom.class);
        util.exportExcel(response, list, "瓦斯抽放泵房数据");
    }

    /**
     * 获取瓦斯抽放泵房详细信息
     */
    @PreAuthorize("@ss.hasPermi('control:gasRoom:query')")
    @GetMapping(value = "/{tagName}")
    public AjaxResult getInfo(@PathVariable("tagName") String tagName) {
        return success(gasDrainagePumpRoomService.selectGasDrainagePumpRoomByTagName(tagName));
    }

    /**
     * 新增瓦斯抽放泵房
     */
    @PreAuthorize("@ss.hasPermi('control:gasRoom:add')")
    @Log(title = "瓦斯抽放泵房", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody GasDrainagePumpRoom gasDrainagePumpRoom) {
        return toAjax(gasDrainagePumpRoomService.insertGasDrainagePumpRoom(gasDrainagePumpRoom));
    }

    /**
     * 修改瓦斯抽放泵房
     */
    @PreAuthorize("@ss.hasPermi('control:gasRoom:edit')")
    @Log(title = "瓦斯抽放泵房", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody GasDrainagePumpRoom gasDrainagePumpRoom) {
        return toAjax(gasDrainagePumpRoomService.updateGasDrainagePumpRoom(gasDrainagePumpRoom));
    }

    /**
     * 删除瓦斯抽放泵房
     */
    @PreAuthorize("@ss.hasPermi('control:gasRoom:remove')")
    @Log(title = "瓦斯抽放泵房", businessType = BusinessType.DELETE)
    @DeleteMapping("/{tagNames}")
    public AjaxResult remove(@PathVariable String[] tagNames) {
        return toAjax(gasDrainagePumpRoomService.deleteGasDrainagePumpRoomByTagNames(tagNames));
    }


    //高、低  负压  值列表
    @GetMapping("/gasValueList")
    public List<GasDrainagePumpRoom> gasValueList() {
        List<GasDrainagePumpRoom> list = gasDrainagePumpRoomService.gasValueList();
        return list;
    }

    //高低水池 液位、水温
    @GetMapping("/gasWaterValue")
    public List<GasDrainagePumpRoom> gasWaterValue() {
        List<GasDrainagePumpRoom> list  = gasDrainagePumpRoomService.gasWaterValue();
        return list;
    }

    //瓦斯、温度、负压、工况流量、标准流量、一氧化碳
    @GetMapping("/gasGasValue")
    public List<GasDrainagePumpRoom> gasGasValue() {
        List<GasDrainagePumpRoom> list  = gasDrainagePumpRoomService.gasGasValue();
        return list;
    }

    //环境瓦斯、环境温度
    @GetMapping("/getHJWSWD")
    public List<GasDrainagePumpRoom> getHJWSWD() {
        List<GasDrainagePumpRoom> list  = gasDrainagePumpRoomService.getHJWSWD();
        return list;
    }

    //供水状态、远控、就地、检修
    @GetMapping("/getWaterStatus")
    public List<GasDrainagePumpRoom> getWaterStatus() {
        List<GasDrainagePumpRoom> list  = gasDrainagePumpRoomService.getWaterStatus();
        return list;
    }

    //泵负压
    @GetMapping("/getFyValue")
    public List<GasDrainagePumpRoom> getFyValue() {
        List<GasDrainagePumpRoom> list  = gasDrainagePumpRoomService.getFyValue();
        return list;
    }

    //供水状态、远控、就地、检修
    @GetMapping("/getWaterState")
    public List<GasDrainagePumpRoom> getWaterState() {
        List<GasDrainagePumpRoom> list  = gasDrainagePumpRoomService.getWaterState();
        return list;
    }


    /**
     * 大屏  瓦斯  电压电流列表
     */
    @GetMapping("/getGasValueList")
    public List<GasDrainagePumpRoom> getGasValueList() {
        List<GasDrainagePumpRoom> list  = gasDrainagePumpRoomService.getGasValueList();
        return list;
    }


    /**
     * 大营接口
     */

    /**
     * 高低负压  工况流量、瓦斯、负压、温度、一氧化碳、标况流量
     */
    @GetMapping("/gasDyFyValueList")
    public List<GasDrainagePumpRoom> gasDyFyValueList() {
        List<GasDrainagePumpRoom> list = gasDrainagePumpRoomService.gasDyFyValueList();
        return list;
    }


    /**
     * 出气阀、进气阀、水阀  关到位、开到位
     */
    @GetMapping("/gasDyFMValueList")
    public List<GasDrainagePumpRoom> gasDyFMValueList() {
        List<GasDrainagePumpRoom> list = gasDrainagePumpRoomService.gasDyFMValueList();
        return list;
    }


    /**
     * 1、2、5、6  泵  电机前轴、后轴、绕组A、B/C 电压、电流、泵真空度
     *  * TODO 泵真空度
     */
    @GetMapping("/gasDyValueListOne")
    public List<GasDrainagePumpRoom> gasDyValueListOne() {
        List<GasDrainagePumpRoom> list = gasDrainagePumpRoomService.gasDyValueListOne();
        return list;
    }


    /**
     * 7、8、9、10  泵  电机前轴、后轴、绕组A、B/C 电压、电流、泵真空度
     * TODO 泵真空度
     */
    @GetMapping("/gasDyValueListTwo")
    public List<GasDrainagePumpRoom> gasDyValueListTwo() {
        List<GasDrainagePumpRoom> list = gasDrainagePumpRoomService.gasDyValueListTwo();
        return list;
    }

    /**
     *  1、2、5、6、7、8、9、10  有水、远控、就地、检修
     */
    @GetMapping("/gasDyWaterValueList")
    public List<GasDrainagePumpRoom> gasDyWaterValueList() {
        List<GasDrainagePumpRoom> list = gasDrainagePumpRoomService.gasDyWaterValueList();
        return list;
    }

    /**
     * 高、低  水位、水温
     */
    @GetMapping("/gasDyWaterTemp")
    public List<GasDrainagePumpRoom> gasDyWaterTemp() {
        List<GasDrainagePumpRoom> list = gasDrainagePumpRoomService.gasDyWaterTemp();
        return list;
    }

    /**
     * 环境瓦斯1、2
     */
    @GetMapping("/gasDyGasValueList")
    public List<GasDrainagePumpRoom> gasDyGasValueList() {
        List<GasDrainagePumpRoom> list = gasDrainagePumpRoomService.gasDyGasValueList();
        return list;
    }


    /**
     *  大营大屏  瓦斯  电压电流列表
     */
    @GetMapping("/getDyDpGasValueList")
    public List<GasDrainagePumpRoom> getDyDpGasValueList() {
        List<GasDrainagePumpRoom> list  = gasDrainagePumpRoomService.getDyDpGasValueList();
        return list;
    }


    /**
     * 苍海接口
     */

    /**
     * 高低负压  工况流量、瓦斯、负压、温度、一氧化碳、标况流量
     */
    @GetMapping("/gasChFyValueList")
    public List<GasDrainagePumpRoom> gasChFyValueList() {
        List<GasDrainagePumpRoom> list = gasDrainagePumpRoomService.gasChFyValueList();
        return list;
    }

    /**
     * 低负压1、2 高负压1、2 电机前轴、后轴、绕组A、B/C 电压、电流、泵体前轴、后轴
     */
    @GetMapping("/gasChGdfyValueList")
    public List<GasDrainagePumpRoom> gasChGdfyValueList() {
        List<GasDrainagePumpRoom> list = gasDrainagePumpRoomService.gasChGdfyValueList();
        return list;
    }

    /**
     * 高、低  水位、水温
     */
    @GetMapping("/gasChWaterTemp")
    public List<GasDrainagePumpRoom> gasChWaterTemp() {
        List<GasDrainagePumpRoom> list = gasDrainagePumpRoomService.gasChWaterTemp();
        return list;
    }

    /**
     * 出气阀、进气阀、水阀  关到位、开到位
     */
    @GetMapping("/gasChFMValueList")
    public List<GasDrainagePumpRoom> gasChFMValueList() {
        List<GasDrainagePumpRoom> list = gasDrainagePumpRoomService.gasChFMValueList();
        return list;
    }

    /**
     *   有水、远控、就地、检修
     */
    @GetMapping("/gasChWaterValueList")
    public List<GasDrainagePumpRoom> gasChWaterValueList() {
        List<GasDrainagePumpRoom> list = gasDrainagePumpRoomService.gasChWaterValueList();
        return list;
    }

    /**
     *   泵负压
     */
    @GetMapping("/gasChBfyValueList")
    public List<GasDrainagePumpRoom> gasChBfyValueList() {
        List<GasDrainagePumpRoom> list = gasDrainagePumpRoomService.gasChBfyValueList();
        return list;
    }


    /**
     *  苍海大屏  瓦斯  电压电流列表
     */
    @GetMapping("/getChDpGasValueList")
    public List<GasDrainagePumpRoom> getChDpGasValueList() {
        List<GasDrainagePumpRoom> list  = gasDrainagePumpRoomService.getChDpGasValueList();
        return list;
    }

}
